package com.ukadas.eduko.modelo.mtm;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.ukadas.eduko.modelo.Alumno;
import com.ukadas.eduko.modelo.Familiar;
import com.ukadas.eduko.modelo.tipos.TipoFamiliar;

@Entity
@Table(name="alumnos_familiares")
public class AlumnoFamiliar {

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="id_alumno_familiar")
	private int idAlumnoFamiliar;
	
	@ManyToOne
	@JoinColumn(name="id_alumno",referencedColumnName="id_persona")
	private Alumno alumno;
	
	@ManyToOne
	@JoinColumn(name="id_familiar", referencedColumnName="id_persona")
	private Familiar familiar;
	
	@ManyToOne
	@JoinColumn(name="id_tipo_familiar", referencedColumnName="id_tipo")
	private TipoFamiliar tipoFamiliar;

	AlumnoFamiliar() {
		super();
		// TODO Auto-generated constructor stub
	}

	AlumnoFamiliar(int idAlumnoFamiliar, Alumno alumno, Familiar familiar,
			TipoFamiliar tipoFamiliar) {
		super();
		this.idAlumnoFamiliar = idAlumnoFamiliar;
		this.alumno = alumno;
		this.familiar = familiar;
		this.tipoFamiliar = tipoFamiliar;
	}

	public int getIdAlumnoFamiliar() {
		return idAlumnoFamiliar;
	}

	public void setIdAlumnoFamiliar(int idAlumnoFamiliar) {
		this.idAlumnoFamiliar = idAlumnoFamiliar;
	}

	public Alumno getAlumno() {
		return alumno;
	}

	public void setAlumno(Alumno alumno) {
		this.alumno = alumno;
	}

	public Familiar getFamiliar() {
		return familiar;
	}

	public void setFamiliar(Familiar familiar) {
		this.familiar = familiar;
	}

	public TipoFamiliar getTipoFamiliar() {
		return tipoFamiliar;
	}

	public void setTipoFamiliar(TipoFamiliar tipoFamiliar) {
		this.tipoFamiliar = tipoFamiliar;
	}

	@Override
	public String toString() {
		return "AlumnoFamiliar [idAlumnoFamiliar=" + idAlumnoFamiliar
				+ ", alumno=" + alumno + ", familiar=" + familiar
				+ ", tipoFamiliar=" + tipoFamiliar + "]";
	}
	
	
}
